Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 05-05-2008, 02:41 PM   #1
Solid State Member
 
Join Date: May 2008
Posts: 6
Default Is this same as C++??

I play a game called GTA SAMP ( gta san andreas multiplayer) which is a mod for GTA san andreas so you can play online in servers( on pc). Anyway, you can make a server and get people to join the server e.t.c. When you make a server you make a "script" in a program called "pawno", Today i was looking at the C++ language and i noticed the Pawno scripts are similar to C++, In the script you make commands so when in the server, if you say /help it will give a message to either you, everyone in game,and so on, ANYWAY.. i will give you a couple of pawno scripts and tell me how close it is to C++, and if i can do this, i could probaly learn C++.....


This is the Code's which tell the script What to include. and the NEW's are wich are a new word basicly
Code:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
static gTeam[MAX_PLAYERS];
#pragma dynamic 8192


new Menu:menu;

new bomb;
forward allah();

new barzinigate;
new lvpdgate;
new nggate1;

A /help command, which has lots of "Else If" so, if PJOB is 3 for example, it aslo says that...
Code:
	if(strcmp(cmd, "/help", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    SendClientMessage(playerid, COLOR_WHITE,"*** ACCOUNT *** /rules /login /stats /buylevel /upgrade /buylicenses /quitfaction");
			SendClientMessage(playerid, COLOR_WHITE,"*** GENERAL *** /pay /charity /time /buy /unrentcar /givekey /switchkey /id /drink /music /showlicenses /clothes");
			SendClientMessage(playerid, COLOR_WHITE,"*** GENERAL *** /resetupgrades(100k) /buygun /lock /skill /portable /licenses /lotto /sleep /wakeup /stopani");
			SendClientMessage(playerid, COLOR_WHITE,"*** GENERAL *** /report /cancel /accept /eject /usedrugs /contract /fill /fillcar /clear /service /families");
	  		SendClientMessage(playerid, COLOR_WHITE,"*** CHAT *** (/w)hisper (/o)oc (/s)hout (/c)lose (/l)ocal (/b) (/ad)vertise (/f)amily /me /togooc /tognews /togfam /togwhisper /map /fuel");
			SendClientMessage(playerid, COLOR_WHITE,"*** BANK *** /balance /withdraw /deposit /wiretransfer");
            if(PlayerInfo[playerid][pJob] == 1) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find"); }
		    else if(PlayerInfo[playerid][pJob] == 2) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /free"); }
		    else if(PlayerInfo[playerid][pJob] == 3) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex"); }
		    else if(PlayerInfo[playerid][pJob] == 4) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrugs"); }
		    else if(PlayerInfo[playerid][pJob] == 5) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar"); }
		    else if(PlayerInfo[playerid][pJob] == 7) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /repair /refill /duty"); }
		    else if(PlayerInfo[playerid][pJob] == 8) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard"); }
		    else if(PlayerInfo[playerid][pJob] == 9) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guns get /guns deliver /sellgun"); }
		    else if(PlayerInfo[playerid][pJob] == 10) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellcar"); }
		    else if(PlayerInfo[playerid][pJob] == 12) {
		    SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight /boxstats"); }
		    
			if (gTeam[playerid] == 2 || IsACop(playerid))
			{
				SendClientMessage(playerid, COLOR_WHITE, "*** LVPD/FBI/NG *** (/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /arrest /duty /wanted /cuff /tazer");
				SendClientMessage(playerid, COLOR_WHITE, "*** LVPD/FBI/NG *** /frisk /take /ticket (/gov)ernment /deliver /camera /ram /detain /roof /nameon /nameoff on/off /opengate");
			}
			if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
			{
			SendClientMessage(playerid, COLOR_GRAD3,"*** HITMAN *** /portable /nameon /nameoff - RANK 4+");
			}
			if(PlayerInfo[playerid][pLeader] == 7)
			{
			SendClientMessage(playerid, COLOR_GRAD3,"*** President *** /settax /givetax /fire /d /opengate");
			}
			if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
			{
				SendClientMessage(playerid, COLOR_WHITE, "*** FAMILY *** /family /tie /roof /nameon /nameoff /opengate");
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendClientMessage(playerid, COLOR_WHITE, "*** ADMIN *** (/a)dmin (/ah)elp");
			}
			SendClientMessage(playerid, COLOR_WHITE,"*** OTHER *** /cellphonehelp /househelp /renthelp /businesshelp /leaderhelp /fishhelp /cookhelp /irchelp /ganghelp");
		}
		return 1;
	}

Well, anyway, does this look like C++?? i also have a screenshot!! this i found on google though, i thought it was much quiker as it shows the exact same layout!
__________________

Mowgli is offline   Reply With Quote
Old 05-05-2008, 04:32 PM   #2
In Runtime
 
Join Date: Apr 2008
Posts: 230
Default Re: Is this same as C++??

Its close, though a lot of languages are. There will be different syntax for different commands but the general layout looks fairly similar

C++ generally has classes and such but I don't see that in this language (because this one is probably more of a procedural language than an OO language).
__________________

silent1mezzo is offline   Reply With Quote
Old 05-21-2008, 08:06 PM   #3
Beta Member
 
Join Date: May 2008
Posts: 3
Default Re: Is this same as C++??

looks like it... structure is exactly the same and same reserved words.. but some compilers are different so the syntax is different but it will still be c++
backintheday23 is offline   Reply With Quote
Old 05-21-2008, 08:35 PM   #4
Site Team
 
celegorm's Avatar
 
Join Date: Sep 2006
Posts: 10,713
Send a message via AIM to celegorm
Default Re: Is this same as C++??

If that's not C++, then it would almost have to be C#.
__________________
"as a fanboy i refuse to admit it and will pull countless things out of my butt to disprove it"

Team Thelegorm! Total Kills: 21 (i iz in uor profile, editsing your sigz)
celegorm is offline   Reply With Quote
Old 05-21-2008, 10:27 PM   #5
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Is this same as C++??

One way to tell is that a lot of C++ programs use the "namespace std" while C# programs use "system"
JogaBonito1502 is offline   Reply With Quote
Old 05-21-2008, 10:28 PM   #6
Site Team
 
celegorm's Avatar
 
Join Date: Sep 2006
Posts: 10,713
Send a message via AIM to celegorm
Default Re: Is this same as C++??

Quote:
Originally Posted by JogaBonito1502 View Post
One way to tell is that a lot of C++ programs use the "namespace std" while C# programs use "system"
I actually didn't use namespace until I started using the 2008 C++ compiler, and have used system in c++.
__________________
"as a fanboy i refuse to admit it and will pull countless things out of my butt to disprove it"

Team Thelegorm! Total Kills: 21 (i iz in uor profile, editsing your sigz)
celegorm is offline   Reply With Quote
Old 05-21-2008, 10:35 PM   #7
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Is this same as C++??

Quote:
Originally Posted by celegorm View Post
I actually didn't use namespace until I started using the 2008 C++ compiler, and have used system in c++.
Really? Wow, a lot of the code I have read/revised have been "system" for C# and "namespace std" for C++. I just now got into using classes and structures. I need to review pointers. They are very useful just slightly complicated. I really need a project to work on this summer...
__________________

JogaBonito1502 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0