Is this same as C++??

Mowgli

Solid State Member
Messages
6
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!
Editor_pawno_small.jpg
 
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).
 
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++
 
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...
 
Back
Top Bottom